package GUI;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class incorrectRegister extends JFrame{
    JPanel incorrectPanel = new JPanel(new GridLayout(4, 1,20,20));
    JLabel lab1=new JLabel("该账号已注册！");
    JLabel lab2=new JLabel(" ");
    JButton but = new JButton("返回");
        public incorrectRegister(){
            this.setSize(200,230);
            incorrectPanel.setSize(this.getSize());
            incorrectPanel.add(lab2);
            incorrectPanel.add(lab1);
            incorrectPanel.add(but);
            but.setBackground(Color.lightGray);
            but.addActionListener(new backListener());
            this.getContentPane().add(BorderLayout.CENTER,incorrectPanel);
            this.setLayout(new FlowLayout());//流式布局
            this.setLocationRelativeTo(null);//居中
            this.setTitle("在线考试平台");
            this.setVisible(true);
            //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        }
    public class backListener implements ActionListener {

        @Override
        public void actionPerformed(ActionEvent e) {//关闭注册界面
            incorrectRegister.this.dispose();
            new enterWindow();
        }
    }
}
